// 1，使用async解决co-generator手动遍历问题
const ajax = require('../promise基础使用/用promise封装原生ajax')
async function main(){
  try {
    const user = await ajax('/api/users.json')
    console.log(users)
    const posts = await ajax('/api/posts.json')
    console.log(posts)
    const urls = await ajax('/api/urls.json')
    console.log(urls)
  } catch (error) {
    console.log(e)
  }
}

promise.then(() => {
  console.log('all completed')
})